applicationwindow: fix leak of help_overlay
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Wed, 12 Oct 2016 12:33:39 +0000 (13:33 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 13 Oct 2016 13:39:01 +0000 (09:39 -0400)
commit353281d9d07ac49082cf2de19d7de33d5eb2e02d
tree6d5ac0b7da98cc091b3da4bdbe67aef34de5a92f
parent133da654338544c9d8bf657eb3da3f5902e8889b
applicationwindow: fix leak of help_overlay

> Due to Gtk+ keeping a reference to the window internally,
> gtk_window_new() does not return a reference to the caller.
> To delete a GtkWindow, call gtk_widget_destroy().

Caller(s) aren't expecting a need to delete help_overlay themselves
once they've installed it.  (E.g. see gtk_application_window_added()).

I didn't notice any direct precedents, but there's a parallel in the
current implementation of gtk_container_destroy() which uses
gtk_widget_destroy() on any added widget.

This avoids leaking 100s of kB per window, when I tested nautilus.

https://bugzilla.gnome.org/show_bug.cgi?id=772859
gtk/gtkapplicationwindow.c